#pragma once
#include "drawing.h"
#include "span.h"
#include "scanline.h"
#include "option.h"



typedef struct tag_rasterizer_16
{
	int_16 y;
	int_16 count;
	int_16 index;
	scanline16 * scanlines;

	option16 * options;
	int_16 ocount;
	int_16 oindex;

	int_16 scan_index;
	int_16 span_index;
	int_16 cover_index;
}rasterizer16;



rasterizer16 * rasterizer16_create();
void rasterizer16_destroy(rasterizer16 * pras);


option16 * rasterizer16_next_option(rasterizer16 * pras);
void rasterizer16_option(rasterizer16 * pras, int_16 x, int_16 y, option_command cmd);
void rasterizer16_option_ex(rasterizer16 * pras, int_16 x, int_16 y, int_16 cmd);


scanline16 * rasterizer16_get_scanline(rasterizer16 * pras, int_16 y);
void rasterizer16_add_pixel(rasterizer16 * pras, int_16 x, int_16 y, int_8 cover);

bool rasterizer16_prepare(rasterizer16 * pras);
bool rasterizer16_rasterizer(rasterizer16 * pras, int_16 * px, int_16 * py, uint_8 * pcover);